home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / autocad / R14601.DXR / 00002_refScript.ls < prev    next >
Encoding:
Text File  |  1997-04-24  |  7.4 KB  |  150 lines

  1. property pTextDisplaySprite, pSectButtonSpriteList, pSectButtonFirstMemNum, pButtonObjectList, pScrollBarObj, pThumbSprite, pDisplayTextList, pSectButtonSpriteListTwo, pSectButtonFirstMemNumTwo, pWhiteSprite_a, pWhiteSprite_b, pWhiteSprite_c, pWhiteSprite_d, pWhiteSprite_e
  2. global gScript, gVoid
  3.  
  4. on initReferenceScreen
  5.   set gScript to script "refScript"
  6.   set the pTextDisplaySprite of gScript to 4
  7.   set the pWhiteSprite_a of gScript to 14
  8.   set the pWhiteSprite_b of gScript to 15
  9.   set the pWhiteSprite_c of gScript to 16
  10.   set the pWhiteSprite_d of gScript to 17
  11.   set the pWhiteSprite_e of gScript to 18
  12.   hideWhiteSections()
  13.   go("reference")
  14.   puppetAllSprites(1)
  15.   initRefText()
  16.   initRefControls()
  17. end
  18.  
  19. on closeReferenceScreen
  20.   puppetAllSprites(0)
  21.   put " " into field "textDisplay"
  22.   put " " into field "textPrint"
  23.   if not objectp(gScript) then
  24.     exit
  25.   end if
  26.   cleanUpBeforeLeaving()
  27.   repeat with i = 1 to count(gScript)
  28.     setaProp(gScript, getPropAt(gScript, i), gVoid)
  29.   end repeat
  30.   set gScript to gVoid
  31. end
  32.  
  33. on initRefControls
  34.   set the pButtonObjectList of gScript to [:]
  35.   set the pSectButtonSpriteList of gScript to [11, 12]
  36.   set the pSectButtonFirstMemNum of gScript to the number of member "prod01"
  37.   set tCommandList to ["displayRefInfo([#text:#product],TRUE)", "showWhiteSections"]
  38.   repeat with i = 1 to count(the pSectButtonSpriteList of gScript)
  39.     set currSpriteNum to getAt(the pSectButtonSpriteList of gScript, i)
  40.     addProp(the pButtonObjectList of gScript, currSpriteNum, birth(script "sectButton Parent Script", currSpriteNum, the pSectButtonFirstMemNum of gScript + ((i * 3) - 3), i, getAt(tCommandList, i)))
  41.   end repeat
  42.   set the pSectButtonSpriteListTwo of gScript to [the pWhiteSprite_a of gScript, the pWhiteSprite_b of gScript, the pWhiteSprite_c of gScript, the pWhiteSprite_d of gScript, the pWhiteSprite_e of gScript]
  43.   set the pSectButtonFirstMemNumTwo of gScript to the number of member "white_a01"
  44.   set tCommandListTwo to ["displayRefInfo([#text:#white_a])", "displayRefInfo([#text:#white_b])", "displayRefInfo([#text:#white_c])", "displayRefInfo([#text:#white_d])", "displayRefInfo([#text:#white_e])"]
  45.   repeat with j = 1 to count(the pSectButtonSpriteListTwo of gScript)
  46.     set currSpriteNum to getAt(the pSectButtonSpriteListTwo of gScript, j)
  47.     addProp(the pButtonObjectList of gScript, currSpriteNum, birth(script "sectButton Parent Script Two", currSpriteNum, the pSectButtonFirstMemNumTwo of gScript + ((j * 3) - 3), j, getAt(tCommandListTwo, j)))
  48.   end repeat
  49.   set tBar to 6
  50.   set tTop to 7
  51.   set tBot to 8
  52.   set tThm to 9
  53.   set tPrt to 13
  54.   set the pThumbSprite of gScript to tThm
  55.   set tStdButtonList to [[#sprite: tPrt, #firstMember: the number of member "print01", #command: "printCurrentText", #repeat: 0, #down: 0, #delay: 15], [#sprite: tBar, #firstMember: the number of member "scrbar01", #command: "mClickScrollBar(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tTop, #firstMember: the number of member "scrtop01", #command: "mClickUpArrow(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tBot, #firstMember: the number of member "scrbot01", #command: "mClickDownArrow(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tThm, #firstMember: the number of member "scrthm01", #command: "mClickBoxButton(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #forceRoll: 1]]
  56.   repeat with tCurrButtonProps in tStdButtonList
  57.     addProp(the pButtonObjectList of gScript, the sprite of tCurrButtonProps, new(script "stdButtonClass", tCurrButtonProps))
  58.   end repeat
  59.   updateStage()
  60.   set the pScrollBarObj of gScript to new(script "ScrollBarClass", [#pTopArrowSprite: tTop, #pBotArrowSprite: tBot, #pBoxButtonSprite: tThm, #pScrollBarSprite: tBar, #pFieldMember: member "textDisplay"])
  61.   mClickOnButton(getaProp(the pButtonObjectList of gScript, 11), "Mouse Down", 1)
  62. end
  63.  
  64. on initRefText
  65.   set tFileList to [#product: "faxable1.txt", #white_a: "review2.txt", #white_b: "r14upgr2.txt", #white_c: "r14prgd1.txt", #white_d: "r14prgd2.txt", #white_e: "cbtwhite.txt"]
  66.   set the pDisplayTextList of gScript to [:]
  67.   if not doesXtraExist("fileio") then
  68.     alert("The FileIO Xtra is not in the Xtras directory.")
  69.     exit
  70.   end if
  71.   set tFileIO to new(xtra("fileio"))
  72.   if not objectp(tFileIO) then
  73.     alert("Problem using FileIO Xtra, check to make sure it's there ...")
  74.     exit
  75.   end if
  76.   repeat with i = 1 to count(tFileList)
  77.     set tFileName to the pathName & getAt(tFileList, i)
  78.     openFile(tFileIO, tFileName, 1)
  79.     set tString to readFile(tFileIO)
  80.     set tStatus to status(tFileIO)
  81.     closeFile(tFileIO)
  82.     set tCurrProp to getPropAt(tFileList, i)
  83.     if tStatus <> 0 then
  84.       addProp(the pDisplayTextList of gScript, tCurrProp, "Couldn't load text file: " & tFileName)
  85.       next repeat
  86.     end if
  87.     set tString to removeLFCharFromText(tString)
  88.     addProp(the pDisplayTextList of gScript, tCurrProp, tString)
  89.   end repeat
  90.   set tFileIO to 0
  91. end
  92.  
  93. on cleanUpBeforeLeaving
  94.   if listp(the pButtonObjectList of gScript) then
  95.     repeat with i = 1 to count(the pButtonObjectList of gScript)
  96.       set tActPos to getPos(the actorList, getAt(the pButtonObjectList of gScript, i))
  97.       if tActPos > 0 then
  98.         deleteAt(the actorList, tActPos)
  99.       end if
  100.     end repeat
  101.   end if
  102.   set the pButtonObjectList of gScript to [:]
  103. end
  104.  
  105. on displayRefInfo myProps, myHideWhiteSectionsFlag
  106.   if myHideWhiteSectionsFlag = 1 then
  107.     hideWhiteSections()
  108.     set the pSectCurrent of getaProp(the pButtonObjectList of gScript, the pWhiteSprite_a of gScript) to 0
  109.   end if
  110.   put getaProp(the pDisplayTextList of gScript, the text of myProps) into field "textDisplay"
  111.   reset(the pScrollBarObj of gScript)
  112. end
  113.  
  114. on showWhiteSections
  115.   set the visible of sprite the pWhiteSprite_a of gScript to 1
  116.   set the visible of sprite the pWhiteSprite_b of gScript to 1
  117.   set the visible of sprite the pWhiteSprite_c of gScript to 1
  118.   set the visible of sprite the pWhiteSprite_d of gScript to 1
  119.   set the visible of sprite the pWhiteSprite_e of gScript to 1
  120.   set the visible of sprite (the pWhiteSprite_a of gScript + 5) to 1
  121.   set the visible of sprite (the pWhiteSprite_b of gScript + 5) to 1
  122.   set the visible of sprite (the pWhiteSprite_c of gScript + 5) to 1
  123.   set the visible of sprite (the pWhiteSprite_d of gScript + 5) to 1
  124.   set the visible of sprite (the pWhiteSprite_e of gScript + 5) to 1
  125.   mClickOnButton(getaProp(the pButtonObjectList of gScript, the pWhiteSprite_a of gScript), "Mouse Down", 1)
  126. end
  127.  
  128. on hideWhiteSections
  129.   set the visible of sprite the pWhiteSprite_a of gScript to 0
  130.   set the visible of sprite the pWhiteSprite_b of gScript to 0
  131.   set the visible of sprite the pWhiteSprite_c of gScript to 0
  132.   set the visible of sprite the pWhiteSprite_d of gScript to 0
  133.   set the visible of sprite the pWhiteSprite_e of gScript to 0
  134.   set the visible of sprite (the pWhiteSprite_a of gScript + 5) to 0
  135.   set the visible of sprite (the pWhiteSprite_b of gScript + 5) to 0
  136.   set the visible of sprite (the pWhiteSprite_c of gScript + 5) to 0
  137.   set the visible of sprite (the pWhiteSprite_d of gScript + 5) to 0
  138.   set the visible of sprite (the pWhiteSprite_e of gScript + 5) to 0
  139. end
  140.  
  141. on printCurrentText
  142.   if doesXtraExist("printomatic") then
  143.     register(xtra("printomatic"), "POMX153-485-02542")
  144.     set the text of member "textPrint" to the text of member "textDisplay"
  145.     print(member "textPrint")
  146.   else
  147.     alert("The PrintoMatic Xtra isn't in the Xtras directory.")
  148.   end if
  149. end
  150.